<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="common/taglibs.jsp" %>

<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<%@ include file="common/btcss.jsp" %>
	
	<link rel="stylesheet" href="${ctx }/static/lib/weekdatepicker/css/default.css">
	<link rel="stylesheet" href="${ctx }/static/lib/datatables/1.10.9/css/jquery.dataTables.min.css">
	<link rel="stylesheet" href="${ctx }/static/lib/uploadify/3.1/css/uploadify.css">
	
	<title>资源白名单配置管理系统</title>
	
	<style>
		.icon-cancel{
			background:url('${ctx}/static/images/cancel.png') no-repeat center center;
		}
	</style>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-2">投放时间段选择</div>
			<div id="datepicker" class="col-md-10"></div>
		</div>
	</div>
	
	<div class="container" style="margin-bottom: 10px;">
        <input id="test" type="button" class="btn btn-primary" value="测试返回数据" />
    </div>
    
    <div class="container">
   	    <table class="table table-striped table-bordered example">
				<thead>
					<tr>
						<th>编号</th>
						<th>渠道</th>
						<th>资源</th>
						<th>IPCC</th>
						<th>设置航线</th>
						<th>开启/关闭</th>
						<th>总开关</th>
						<th>操作</th>
					</tr>
				</thead>
		</table>
    </div>
    
    <button id="myModel" type="button" class="btn btn-primary">
        Open modal for @mdo</button>
    <div class="container">
    	<div class="row">
    		<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
		        <div class="modal-dialog" role="document">
		            <div class="modal-content">
		                <div class="modal-header">
		                    <!--
		                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
		                        <span aria-hidden="true">&times;</span>
		                    </button>-->
		                    <h4 class="modal-title" id="exampleModalLabel">批量导入航线数据</h4>
		                </div>
		                <div class="modal-body">
		                	<form>
								<div id="queueID"></div>
								<input id="file_upload" name="file_upload" type="file" multiple="true">
							</form>
							
							<form id="importform">
								<input id="filenames" name="filenames" type="hidden" value="" />
								<input id="mid" name="mid" type="hidden" value="1" />
								<div id="result">
								</div>
							</form>
	                    	
	                    	<a class="btn btn-primary" href="javascript:$('#file_upload').uploadify('upload','*')">开始上传</a>&nbsp;
        					<a class="btn btn-danger" href="javascript:$('#file_upload').uploadify('cancel', '*')">取消所有上传</a>
        					
        					<div style="text-align: center;">
        						<label class="control-label" id="impsuccess"></label>
        					</div>
		                </div>
		                <div class="modal-footer">
		                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
		                    <button type="button" class="btn btn-primary" id="import">导入</button>
		                </div>
		            </div>
		        </div>
		    </div>
    	</div>
    </div>
    
    <div class="container">
    	<div class="row">
    		<select id="searchCID" name="searchCID" onchange="changeCid(this, 'searchDS', 'searchIPCC', ds_array);"></select>
			<select id="searchDS" name="searchDS" onchange="changeRs(this, 'searchIPCC', ipcc_array);"></select>
			<select id="searchIPCC" name="seachrIPCC"></select>
		
			<input type="button"  value="获取选择数据" onclick="showAreaID();"/>
    	</div>
    </div>
    
    <div id="outter" style="display: none;">
        <div id="showData"></div>
    </div>
	
	<%@ include file="common/btjs.jsp" %>
	
	<script src="${ctx }/static/lib/weekdatepicker/js/weekDataPicker.js"></script>
	<script src="${ctx }/static/lib/datatables/1.10.9/js/jquery.dataTables.js"></script>
	<script src="${ctx }/static/lib/datatables/1.10.9/js/dataTables.bootstrap.js"></script>
	<script src="${ctx }/static/lib/uploadify/3.1/js/jquery.uploadify.min.js"></script>
	<script src="${ctx }/static/js/config_cid__rs_ipcc.js"></script>
	<script src="${ctx }/static/js/initConfig.js"></script>
	
	<script src="${ctx }/static/js/demo.js"></script>
	<script type="text/javascript">
		var global;
		var confrimObj;
		//测试用
		var str0 = '{ "xs-1": { "xs-1-0": "0", "xs-1-1": "1", "xs-1-2": "1", "xs-1-3": "1", "xs-1-4": "1", "xs-1-5": "1", "xs-1-6": "1", "xs-1-7": "0", "xs-1-8": "1", "xs-1-9": "1", "xs-1-10": "0", "xs-1-11": "1", "xs-1-12": "1", "xs-1-13": "1", "xs-1-14": "1", "xs-1-15": "1", "xs-1-16": "1", "xs-1-17": "1", "xs-1-18": "1", "xs-1-19": "1", "xs-1-20": "1", "xs-1-21": "1", "xs-1-22": "1", "xs-1-23": "1" }, "xs-2": { "xs-2-0": "1", "xs-2-1": "1", "xs-2-2": "1", "xs-2-3": "1", "xs-2-4": "1", "xs-2-5": "1", "xs-2-6": "1", "xs-2-7": "1", "xs-2-8": "1", "xs-2-9": "1", "xs-2-10": "1", "xs-2-11": "1", "xs-2-12": "1", "xs-2-13": "1", "xs-2-14": "1", "xs-2-15": "1", "xs-2-16": "1", "xs-2-17": "1", "xs-2-18": "1", "xs-2-19": "1", "xs-2-20": "1", "xs-2-21": "1", "xs-2-22": "1", "xs-2-23": "1" }, "xs-3": { "xs-3-0": "1", "xs-3-1": "1", "xs-3-2": "1", "xs-3-3": "1", "xs-3-4": "1", "xs-3-5": "1", "xs-3-6": "1", "xs-3-7": "1", "xs-3-8": "1", "xs-3-9": "1", "xs-3-10": "1", "xs-3-11": "1", "xs-3-12": "1", "xs-3-13": "1", "xs-3-14": "1", "xs-3-15": "1", "xs-3-16": "1", "xs-3-17": "1", "xs-3-18": "1", "xs-3-19": "1", "xs-3-20": "1", "xs-3-21": "1", "xs-3-22": "1", "xs-3-23": "1" }, "xs-4": { "xs-4-0": "1", "xs-4-1": "1", "xs-4-2": "1", "xs-4-3": "1", "xs-4-4": "1", "xs-4-5": "1", "xs-4-6": "1", "xs-4-7": "1", "xs-4-8": "1", "xs-4-9": "1", "xs-4-10": "1", "xs-4-11": "1", "xs-4-12": "1", "xs-4-13": "1", "xs-4-14": "1", "xs-4-15": "1", "xs-4-16": "1", "xs-4-17": "1", "xs-4-18": "1", "xs-4-19": "1", "xs-4-20": "1", "xs-4-21": "1", "xs-4-22": "1", "xs-4-23": "1" }, "xs-5": { "xs-5-0": "1", "xs-5-1": "1", "xs-5-2": "1", "xs-5-3": "1", "xs-5-4": "1", "xs-5-5": "1", "xs-5-6": "1", "xs-5-7": "1", "xs-5-8": "1", "xs-5-9": "1", "xs-5-10": "1", "xs-5-11": "1", "xs-5-12": "1", "xs-5-13": "1", "xs-5-14": "1", "xs-5-15": "1", "xs-5-16": "1", "xs-5-17": "1", "xs-5-18": "1", "xs-5-19": "1", "xs-5-20": "1", "xs-5-21": "1", "xs-5-22": "1", "xs-5-23": "1" }, "xs-6": { "xs-6-0": "1", "xs-6-1": "1", "xs-6-2": "1", "xs-6-3": "1", "xs-6-4": "1", "xs-6-5": "1", "xs-6-6": "1", "xs-6-7": "1", "xs-6-8": "1", "xs-6-9": "1", "xs-6-10": "1", "xs-6-11": "1", "xs-6-12": "1", "xs-6-13": "1", "xs-6-14": "1", "xs-6-15": "1", "xs-6-16": "1", "xs-6-17": "1", "xs-6-18": "1", "xs-6-19": "1", "xs-6-20": "1", "xs-6-21": "1", "xs-6-22": "1", "xs-6-23": "1" }, "xs-7": { "xs-7-0": "1", "xs-7-1": "1", "xs-7-2": "1", "xs-7-3": "1", "xs-7-4": "1", "xs-7-5": "1", "xs-7-6": "1", "xs-7-7": "1", "xs-7-8": "1", "xs-7-9": "1", "xs-7-10": "1", "xs-7-11": "1", "xs-7-12": "1", "xs-7-13": "1", "xs-7-14": "1", "xs-7-15": "1", "xs-7-16": "1", "xs-7-17": "1", "xs-7-18": "1", "xs-7-19": "1", "xs-7-20": "1", "xs-7-21": "1", "xs-7-22": "1", "xs-7-23": "1" } }';
        var str1 = '{ "xs-1": { "xs-1-0": "1", "xs-1-1": "0", "xs-1-2": "1", "xs-1-3": "1", "xs-1-4": "0", "xs-1-5": "1", "xs-1-6": "1", "xs-1-7": "0", "xs-1-8": "1", "xs-1-9": "1", "xs-1-10": "0", "xs-1-11": "1", "xs-1-12": "1", "xs-1-13": "1", "xs-1-14": "1", "xs-1-15": "1", "xs-1-16": "1", "xs-1-17": "1", "xs-1-18": "1", "xs-1-19": "1", "xs-1-20": "1", "xs-1-21": "1", "xs-1-22": "1", "xs-1-23": "1" }, "xs-2": { "xs-2-0": "1", "xs-2-1": "1", "xs-2-2": "1", "xs-2-3": "1", "xs-2-4": "1", "xs-2-5": "1", "xs-2-6": "1", "xs-2-7": "1", "xs-2-8": "1", "xs-2-9": "1", "xs-2-10": "1", "xs-2-11": "1", "xs-2-12": "1", "xs-2-13": "1", "xs-2-14": "1", "xs-2-15": "1", "xs-2-16": "1", "xs-2-17": "1", "xs-2-18": "1", "xs-2-19": "1", "xs-2-20": "1", "xs-2-21": "1", "xs-2-22": "1", "xs-2-23": "1" }, "xs-3": { "xs-3-0": "1", "xs-3-1": "1", "xs-3-2": "1", "xs-3-3": "1", "xs-3-4": "1", "xs-3-5": "1", "xs-3-6": "1", "xs-3-7": "1", "xs-3-8": "1", "xs-3-9": "1", "xs-3-10": "1", "xs-3-11": "1", "xs-3-12": "1", "xs-3-13": "1", "xs-3-14": "1", "xs-3-15": "1", "xs-3-16": "1", "xs-3-17": "1", "xs-3-18": "1", "xs-3-19": "1", "xs-3-20": "1", "xs-3-21": "1", "xs-3-22": "1", "xs-3-23": "1" }, "xs-4": { "xs-4-0": "1", "xs-4-1": "1", "xs-4-2": "1", "xs-4-3": "1", "xs-4-4": "1", "xs-4-5": "1", "xs-4-6": "1", "xs-4-7": "1", "xs-4-8": "1", "xs-4-9": "1", "xs-4-10": "1", "xs-4-11": "1", "xs-4-12": "1", "xs-4-13": "1", "xs-4-14": "1", "xs-4-15": "1", "xs-4-16": "1", "xs-4-17": "1", "xs-4-18": "1", "xs-4-19": "1", "xs-4-20": "1", "xs-4-21": "1", "xs-4-22": "1", "xs-4-23": "1" }, "xs-5": { "xs-5-0": "1", "xs-5-1": "1", "xs-5-2": "1", "xs-5-3": "1", "xs-5-4": "1", "xs-5-5": "1", "xs-5-6": "1", "xs-5-7": "1", "xs-5-8": "1", "xs-5-9": "1", "xs-5-10": "1", "xs-5-11": "1", "xs-5-12": "1", "xs-5-13": "1", "xs-5-14": "1", "xs-5-15": "1", "xs-5-16": "1", "xs-5-17": "1", "xs-5-18": "1", "xs-5-19": "1", "xs-5-20": "1", "xs-5-21": "1", "xs-5-22": "1", "xs-5-23": "1" }, "xs-6": { "xs-6-0": "1", "xs-6-1": "1", "xs-6-2": "1", "xs-6-3": "1", "xs-6-4": "1", "xs-6-5": "1", "xs-6-6": "1", "xs-6-7": "1", "xs-6-8": "1", "xs-6-9": "1", "xs-6-10": "1", "xs-6-11": "1", "xs-6-12": "1", "xs-6-13": "1", "xs-6-14": "1", "xs-6-15": "1", "xs-6-16": "1", "xs-6-17": "1", "xs-6-18": "1", "xs-6-19": "1", "xs-6-20": "1", "xs-6-21": "1", "xs-6-22": "1", "xs-6-23": "1" }, "xs-7": { "xs-7-0": "1", "xs-7-1": "1", "xs-7-2": "1", "xs-7-3": "1", "xs-7-4": "1", "xs-7-5": "1", "xs-7-6": "1", "xs-7-7": "1", "xs-7-8": "1", "xs-7-9": "1", "xs-7-10": "1", "xs-7-11": "1", "xs-7-12": "1", "xs-7-13": "1", "xs-7-14": "1", "xs-7-15": "1", "xs-7-16": "1", "xs-7-17": "1", "xs-7-18": "1", "xs-7-19": "1", "xs-7-20": "1", "xs-7-21": "1", "xs-7-22": "1", "xs-7-23": "1" } }';
        var str2 = '{ "xs-1": { "xs-1-0": "1", "xs-1-1": "1", "xs-1-2": "0", "xs-1-3": "1", "xs-1-4": "1", "xs-1-5": "1", "xs-1-6": "1", "xs-1-7": "0", "xs-1-8": "1", "xs-1-9": "1", "xs-1-10": "0", "xs-1-11": "1", "xs-1-12": "1", "xs-1-13": "1", "xs-1-14": "1", "xs-1-15": "1", "xs-1-16": "1", "xs-1-17": "1", "xs-1-18": "1", "xs-1-19": "1", "xs-1-20": "1", "xs-1-21": "1", "xs-1-22": "1", "xs-1-23": "1" }, "xs-2": { "xs-2-0": "1", "xs-2-1": "1", "xs-2-2": "1", "xs-2-3": "1", "xs-2-4": "1", "xs-2-5": "1", "xs-2-6": "1", "xs-2-7": "1", "xs-2-8": "1", "xs-2-9": "1", "xs-2-10": "1", "xs-2-11": "1", "xs-2-12": "1", "xs-2-13": "1", "xs-2-14": "1", "xs-2-15": "1", "xs-2-16": "1", "xs-2-17": "1", "xs-2-18": "1", "xs-2-19": "1", "xs-2-20": "1", "xs-2-21": "1", "xs-2-22": "1", "xs-2-23": "1" }, "xs-3": { "xs-3-0": "1", "xs-3-1": "1", "xs-3-2": "1", "xs-3-3": "1", "xs-3-4": "1", "xs-3-5": "1", "xs-3-6": "1", "xs-3-7": "1", "xs-3-8": "1", "xs-3-9": "1", "xs-3-10": "1", "xs-3-11": "1", "xs-3-12": "1", "xs-3-13": "1", "xs-3-14": "1", "xs-3-15": "1", "xs-3-16": "1", "xs-3-17": "1", "xs-3-18": "1", "xs-3-19": "1", "xs-3-20": "1", "xs-3-21": "1", "xs-3-22": "1", "xs-3-23": "1" }, "xs-4": { "xs-4-0": "1", "xs-4-1": "1", "xs-4-2": "1", "xs-4-3": "1", "xs-4-4": "1", "xs-4-5": "1", "xs-4-6": "1", "xs-4-7": "1", "xs-4-8": "1", "xs-4-9": "1", "xs-4-10": "1", "xs-4-11": "1", "xs-4-12": "1", "xs-4-13": "1", "xs-4-14": "1", "xs-4-15": "1", "xs-4-16": "1", "xs-4-17": "1", "xs-4-18": "1", "xs-4-19": "1", "xs-4-20": "1", "xs-4-21": "1", "xs-4-22": "1", "xs-4-23": "1" }, "xs-5": { "xs-5-0": "1", "xs-5-1": "1", "xs-5-2": "1", "xs-5-3": "1", "xs-5-4": "1", "xs-5-5": "1", "xs-5-6": "1", "xs-5-7": "1", "xs-5-8": "1", "xs-5-9": "1", "xs-5-10": "1", "xs-5-11": "1", "xs-5-12": "1", "xs-5-13": "1", "xs-5-14": "1", "xs-5-15": "1", "xs-5-16": "1", "xs-5-17": "1", "xs-5-18": "1", "xs-5-19": "1", "xs-5-20": "1", "xs-5-21": "1", "xs-5-22": "1", "xs-5-23": "1" }, "xs-6": { "xs-6-0": "1", "xs-6-1": "1", "xs-6-2": "1", "xs-6-3": "1", "xs-6-4": "1", "xs-6-5": "1", "xs-6-6": "1", "xs-6-7": "1", "xs-6-8": "1", "xs-6-9": "1", "xs-6-10": "1", "xs-6-11": "1", "xs-6-12": "1", "xs-6-13": "1", "xs-6-14": "1", "xs-6-15": "1", "xs-6-16": "1", "xs-6-17": "1", "xs-6-18": "1", "xs-6-19": "1", "xs-6-20": "1", "xs-6-21": "1", "xs-6-22": "1", "xs-6-23": "1" }, "xs-7": { "xs-7-0": "1", "xs-7-1": "1", "xs-7-2": "1", "xs-7-3": "1", "xs-7-4": "1", "xs-7-5": "1", "xs-7-6": "1", "xs-7-7": "1", "xs-7-8": "1", "xs-7-9": "1", "xs-7-10": "1", "xs-7-11": "1", "xs-7-12": "1", "xs-7-13": "1", "xs-7-14": "1", "xs-7-15": "1", "xs-7-16": "1", "xs-7-17": "1", "xs-7-18": "1", "xs-7-19": "1", "xs-7-20": "1", "xs-7-21": "1", "xs-7-22": "1", "xs-7-23": "1" } }';
        var str3 = '{ "xs-1": { "xs-1-0": "1", "xs-1-1": "1", "xs-1-2": "1", "xs-1-3": "0", "xs-1-4": "1", "xs-1-5": "1", "xs-1-6": "1", "xs-1-7": "0", "xs-1-8": "1", "xs-1-9": "1", "xs-1-10": "0", "xs-1-11": "1", "xs-1-12": "1", "xs-1-13": "1", "xs-1-14": "1", "xs-1-15": "1", "xs-1-16": "1", "xs-1-17": "1", "xs-1-18": "1", "xs-1-19": "1", "xs-1-20": "1", "xs-1-21": "1", "xs-1-22": "1", "xs-1-23": "1" }, "xs-2": { "xs-2-0": "1", "xs-2-1": "1", "xs-2-2": "1", "xs-2-3": "1", "xs-2-4": "1", "xs-2-5": "1", "xs-2-6": "1", "xs-2-7": "1", "xs-2-8": "1", "xs-2-9": "1", "xs-2-10": "1", "xs-2-11": "1", "xs-2-12": "1", "xs-2-13": "1", "xs-2-14": "1", "xs-2-15": "1", "xs-2-16": "1", "xs-2-17": "1", "xs-2-18": "1", "xs-2-19": "1", "xs-2-20": "1", "xs-2-21": "1", "xs-2-22": "1", "xs-2-23": "1" }, "xs-3": { "xs-3-0": "1", "xs-3-1": "1", "xs-3-2": "1", "xs-3-3": "1", "xs-3-4": "1", "xs-3-5": "1", "xs-3-6": "1", "xs-3-7": "1", "xs-3-8": "1", "xs-3-9": "1", "xs-3-10": "1", "xs-3-11": "1", "xs-3-12": "1", "xs-3-13": "1", "xs-3-14": "1", "xs-3-15": "1", "xs-3-16": "1", "xs-3-17": "1", "xs-3-18": "1", "xs-3-19": "1", "xs-3-20": "1", "xs-3-21": "1", "xs-3-22": "1", "xs-3-23": "1" }, "xs-4": { "xs-4-0": "1", "xs-4-1": "1", "xs-4-2": "1", "xs-4-3": "1", "xs-4-4": "1", "xs-4-5": "1", "xs-4-6": "1", "xs-4-7": "1", "xs-4-8": "1", "xs-4-9": "1", "xs-4-10": "1", "xs-4-11": "1", "xs-4-12": "1", "xs-4-13": "1", "xs-4-14": "1", "xs-4-15": "1", "xs-4-16": "1", "xs-4-17": "1", "xs-4-18": "1", "xs-4-19": "1", "xs-4-20": "1", "xs-4-21": "1", "xs-4-22": "1", "xs-4-23": "1" }, "xs-5": { "xs-5-0": "1", "xs-5-1": "1", "xs-5-2": "1", "xs-5-3": "1", "xs-5-4": "1", "xs-5-5": "1", "xs-5-6": "1", "xs-5-7": "1", "xs-5-8": "1", "xs-5-9": "1", "xs-5-10": "1", "xs-5-11": "1", "xs-5-12": "1", "xs-5-13": "1", "xs-5-14": "1", "xs-5-15": "1", "xs-5-16": "1", "xs-5-17": "1", "xs-5-18": "1", "xs-5-19": "1", "xs-5-20": "1", "xs-5-21": "1", "xs-5-22": "1", "xs-5-23": "1" }, "xs-6": { "xs-6-0": "1", "xs-6-1": "1", "xs-6-2": "1", "xs-6-3": "1", "xs-6-4": "1", "xs-6-5": "1", "xs-6-6": "1", "xs-6-7": "1", "xs-6-8": "1", "xs-6-9": "1", "xs-6-10": "1", "xs-6-11": "1", "xs-6-12": "1", "xs-6-13": "1", "xs-6-14": "1", "xs-6-15": "1", "xs-6-16": "1", "xs-6-17": "1", "xs-6-18": "1", "xs-6-19": "1", "xs-6-20": "1", "xs-6-21": "1", "xs-6-22": "1", "xs-6-23": "1" }, "xs-7": { "xs-7-0": "1", "xs-7-1": "1", "xs-7-2": "1", "xs-7-3": "1", "xs-7-4": "1", "xs-7-5": "1", "xs-7-6": "1", "xs-7-7": "1", "xs-7-8": "1", "xs-7-9": "1", "xs-7-10": "1", "xs-7-11": "1", "xs-7-12": "1", "xs-7-13": "1", "xs-7-14": "1", "xs-7-15": "1", "xs-7-16": "1", "xs-7-17": "1", "xs-7-18": "1", "xs-7-19": "1", "xs-7-20": "1", "xs-7-21": "1", "xs-7-22": "1", "xs-7-23": "1" } }';
        var str4 = '{ "xs-1": { "xs-1-0": "1", "xs-1-1": "1", "xs-1-2": "1", "xs-1-3": "1", "xs-1-4": "0", "xs-1-5": "1", "xs-1-6": "1", "xs-1-7": "0", "xs-1-8": "1", "xs-1-9": "1", "xs-1-10": "0", "xs-1-11": "1", "xs-1-12": "1", "xs-1-13": "1", "xs-1-14": "1", "xs-1-15": "1", "xs-1-16": "1", "xs-1-17": "1", "xs-1-18": "1", "xs-1-19": "1", "xs-1-20": "1", "xs-1-21": "1", "xs-1-22": "1", "xs-1-23": "1" }, "xs-2": { "xs-2-0": "1", "xs-2-1": "1", "xs-2-2": "1", "xs-2-3": "1", "xs-2-4": "1", "xs-2-5": "1", "xs-2-6": "1", "xs-2-7": "1", "xs-2-8": "1", "xs-2-9": "1", "xs-2-10": "1", "xs-2-11": "1", "xs-2-12": "1", "xs-2-13": "1", "xs-2-14": "1", "xs-2-15": "1", "xs-2-16": "1", "xs-2-17": "1", "xs-2-18": "1", "xs-2-19": "1", "xs-2-20": "1", "xs-2-21": "1", "xs-2-22": "1", "xs-2-23": "1" }, "xs-3": { "xs-3-0": "1", "xs-3-1": "1", "xs-3-2": "1", "xs-3-3": "1", "xs-3-4": "1", "xs-3-5": "1", "xs-3-6": "1", "xs-3-7": "1", "xs-3-8": "1", "xs-3-9": "1", "xs-3-10": "1", "xs-3-11": "1", "xs-3-12": "1", "xs-3-13": "1", "xs-3-14": "1", "xs-3-15": "1", "xs-3-16": "1", "xs-3-17": "1", "xs-3-18": "1", "xs-3-19": "1", "xs-3-20": "1", "xs-3-21": "1", "xs-3-22": "1", "xs-3-23": "1" }, "xs-4": { "xs-4-0": "1", "xs-4-1": "1", "xs-4-2": "1", "xs-4-3": "1", "xs-4-4": "1", "xs-4-5": "1", "xs-4-6": "1", "xs-4-7": "1", "xs-4-8": "1", "xs-4-9": "1", "xs-4-10": "1", "xs-4-11": "1", "xs-4-12": "1", "xs-4-13": "1", "xs-4-14": "1", "xs-4-15": "1", "xs-4-16": "1", "xs-4-17": "1", "xs-4-18": "1", "xs-4-19": "1", "xs-4-20": "1", "xs-4-21": "1", "xs-4-22": "1", "xs-4-23": "1" }, "xs-5": { "xs-5-0": "1", "xs-5-1": "1", "xs-5-2": "1", "xs-5-3": "1", "xs-5-4": "1", "xs-5-5": "1", "xs-5-6": "1", "xs-5-7": "1", "xs-5-8": "1", "xs-5-9": "1", "xs-5-10": "1", "xs-5-11": "1", "xs-5-12": "1", "xs-5-13": "1", "xs-5-14": "1", "xs-5-15": "1", "xs-5-16": "1", "xs-5-17": "1", "xs-5-18": "1", "xs-5-19": "1", "xs-5-20": "1", "xs-5-21": "1", "xs-5-22": "1", "xs-5-23": "1" }, "xs-6": { "xs-6-0": "1", "xs-6-1": "1", "xs-6-2": "1", "xs-6-3": "1", "xs-6-4": "1", "xs-6-5": "1", "xs-6-6": "1", "xs-6-7": "1", "xs-6-8": "1", "xs-6-9": "1", "xs-6-10": "1", "xs-6-11": "1", "xs-6-12": "1", "xs-6-13": "1", "xs-6-14": "1", "xs-6-15": "1", "xs-6-16": "1", "xs-6-17": "1", "xs-6-18": "1", "xs-6-19": "1", "xs-6-20": "1", "xs-6-21": "1", "xs-6-22": "1", "xs-6-23": "1" }, "xs-7": { "xs-7-0": "1", "xs-7-1": "1", "xs-7-2": "1", "xs-7-3": "1", "xs-7-4": "1", "xs-7-5": "1", "xs-7-6": "1", "xs-7-7": "1", "xs-7-8": "1", "xs-7-9": "1", "xs-7-10": "1", "xs-7-11": "1", "xs-7-12": "1", "xs-7-13": "1", "xs-7-14": "1", "xs-7-15": "1", "xs-7-16": "1", "xs-7-17": "1", "xs-7-18": "1", "xs-7-19": "1", "xs-7-20": "1", "xs-7-21": "1", "xs-7-22": "1", "xs-7-23": "1" } }';
		
		$(function(){
			global = $("#datepicker").weekDataPicker({
                chooseColor: 'greenyellow',
                chooseRgb: 'rgb(173, 255, 47)',
                unChooseColor: '#eee',
                mode: 'edit',
                data : JSON.parse(str0)
            });

			$('#test').click(function(){
	            var map = global.getData();
	            var s = JSON.stringify(map);
	            alert(s);
	        });

			$('#myModel').click(function(){
                $('#exampleModal').modal({
                    backdrop: false,
                    keyboard: false,
                    show: true
                })
            });

			$('#file_upload').uploadify({
		        'swf'      : '${ctx}/static/lib/uploadify/3.1/js/uploadify.swf',
		        'uploader' : 'excel/upload',
		        'queueID ' : 'queueID',
		        'cancelImg': '${ctx}/static/lib/uploadify/3.1/img/uploadify-cancel.png',
		        'auto'     : true,
		        'multi'    : true,
		        'fileTypeDesc' : '.xls|.xlsx',
		        'fileTypeExts'  : '*.xls;*.xlsx',
		        'buttonText': '请选择航线数据文件',
                'onUploadError': errorCallback,
		        'onUploadSuccess': function(file, data, response) {
			        $('#' + file.id).find('.data').html('上传完毕!');
			        if(response == true) {
			        	showInfo(file, data);
				    }
			    }
		    });

            $('#import').click(function(){
            	$.ajax({
            		cache: false,
                    type: "POST",
                    url: "excel/import",
                    data:$('#importform').serialize(),// 你的formid
                    async: false,
                    error: function(request) {
                        alert("Connection error");
                    },
                    success: function(data) {
                        var json = JSON.parse(data);
                        if(json.status == "1") {
                        	$('#impsuccess').html("导入航线数据成功!");
                        } else {
                            $('#impsuccess').html(json.message);
                        }
                    }
                })   
            });

            initConfig('searchCID', 'searchDS', 'searchIPCC', cid_array);

            $(document).delegate('img', 'mouseover', function(){
                var data;
                if($(this).attr('id') == 'XXX') {
                    data = JSON.parse(str0);
                    console.log($(this).attr('id') + str0);
                } else if($(this).attr('id') == 'YYY') {
                    data = JSON.parse(str1);
                    console.log($(this).attr('id') + str1);
                } else if($(this).attr('id') == 'ZZZ') {
                    data = JSON.parse(str2);
                    console.log($(this).attr('id') + str2);
                } else if($(this).attr('id') == 'AAA') {
                    data = JSON.parse(str3);
                    console.log($(this).attr('id') + str3);
                } else {
                    data = JSON.parse(str4);
                    console.log($(this).attr('id') + str4);
                }
                $('#showData').html('');
                sleep(100);
                $('#showData').weekDataPicker({
                    chooseClass: 'digitspan',
                    unchooseClass: 'udigitspan',
                    mode: 'read',
                    data : data
                });

                var $that = $(this);
                $that.popover({
                    html: true,
                    trigger: 'hover',
                    placement: 'left',
                    template:'<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>',
                    content: $('#showData').html()
                });
                sleep(100);
                $that.popover('show');
            });

            $(document).delegate('img', 'mouseout', function(){
                sleep(100);
                $(this).popover('hide');
            });
		});

		function showAreaID() {
			alert($('#searchCID').val());
			alert($('#searchDS').val());
			alert($('#searchIPCC').val());
		}

		//显示提示信息，textstyle2为绿色，即正确信息；textstyl1为红色，即错误信息
        function showInfo(file, data) {
            var res = JSON.parse(data);
            
            var msg = '<div id="div_' + file.id + '" style="height:30px;">' +
                "<input type=\"hidden\" name=\"attach_" + file.id  + "\" id=\"attach_" + file.id + "\" value='" + res.NEW + "' /> " +
                '<span style="font-size:16px; height:26px;">' +
                    '<a target="_blank" href="javascript:void(0);" style="text-decoration:underline;color:black;">' + res.OLD + '</a>&nbsp;&nbsp;' +
                    '<a href="javascript:void(0);" onclick="delAttach(this)" id="del_' + file.id +
                        '" class="icon-cancel" style="width:30px;">&nbsp;&nbsp;&nbsp;&nbsp;</a>' +
                '</span>' +
            '</div>';
            $("#result").append(msg);
        }

        function errorCallback(event, queueId, fileObj, errorObj) {

        }

        function delAttach(obj) {
            $('#' + $(obj).attr("id").replace("del", "div")).remove();
        }

        function sleep(numberMillis) {
            var now = new Date();
            var exitTime = now.getTime() + numberMillis;
            while (true) {
                now = new Date();
                if (now.getTime() > exitTime)
                    return;
            }
        }
	</script>
</body>
</html>